package problems.contest;

/**
 * 第 95 场双周赛
 * <p>https://leetcode.cn/contest/biweekly-contest-95</p>
 *
 * @author habitplus
 * @since 10:35, 2023/1/7
 */
public class BCT95 {
    /**
     * T1|2525. 根据规则将箱子分类
     * <p>https://leetcode.cn/problems/categorize-box-according-to-criteria/</p>
     */
    public String categorizeBox(int length, int width, int height, int mass) {
        final int st = 10000;
        long t = (long) length * width * height;
        boolean b = length >= st || width >= st || height >= st || t >= (long) 1e9;
        boolean h = mass >= 100;

        if (b && h) return "Both";
        else if (b) return "Bulky";
        else if (h) return "Heavy";
        else return "Neither";
    }


    /**
     * T2|2526. 找到数据流中的连续整数
     * <p>https://leetcode.cn/problems/find-consecutive-integers-from-a-data-stream/</p>
     */
    class DataStream {
        int cnt;
        final int K;
        final int V;
        public DataStream(int value, int k) {
            K = k;
            V = value;
            cnt = 0;
        }

        public boolean consec(int num) {
            cnt = num != V ? 0 : cnt + 1;
            return cnt >= K;
        }
    }


    /**
     * T3|2527. 查询数组 Xor 美丽值
     * <p>https://leetcode.cn/problems/find-xor-beauty-of-array/</p>
     */
    public int xorBeauty(int[] nums) {
        int ret = 0;

        for (int i = 0; i < nums.length; ++i) {
            ret ^= nums[i];
        }

        return ret;
    }


}
